package com.horse.pack.common.exception;

import lombok.Data;

/**
 * @author yangliu
 * @date 2024/3/22 12:01 PM
 */
@Data
public class CommonException extends RuntimeException {

    protected Integer code;


    protected Object[] args;

    public CommonException(Integer code, String errorMsg) {
        super(errorMsg);
        this.code = code;
    }


    @Override
    public String toString() {
        String s = getClass().getName();
        String message = getLocalizedMessage();
        return (message != null) ? (s + ": " + code + " " + message) : s;
    }

}
